# -*- coding: utf-8 -*-
# TencentBlueKing is pleased to support the open source community by making
# 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available.
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the MIT License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
#     http://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific language governing permissions and
# limitations under the License.
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.

# Generated by Django 2.2.17 on 2021-01-10 11:17

from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields


class Migration(migrations.Migration):

    dependencies = [
        ('modules', '0001_initial'),
        ('engine', '0003_domain_https_enabled'),
    ]

    operations = [
        migrations.CreateModel(
            name='DeployStepMeta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('phase', models.CharField(choices=[('preparation', '准备阶段'), ('build', '构建阶段'), ('release', '部署阶段')], max_length=16, verbose_name='关联阶段')),
                ('name', models.CharField(db_index=True, max_length=32, verbose_name='步骤名称')),
                ('started_patterns', jsonfield.fields.JSONField(blank=True, default=[], null=True, verbose_name='匹配规则')),
                ('finished_patterns', jsonfield.fields.JSONField(blank=True, default=[], null=True, verbose_name='匹配规则')),
                ('builder_provider', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='step_metas', to='modules.AppSlugBuilder', verbose_name='由 SlugBuild 提供')),
                ('buildpack_provider', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='step_metas', to='modules.AppBuildPack', verbose_name='由 BuildPack 提供')),
            ],
            options={
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='StepMetaSet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=32, verbose_name='步骤集名称')),
                ('is_default', models.BooleanField(default=False, verbose_name='是否为默认步骤集')),
                ('metas', models.ManyToManyField(default=[], related_name='关联步骤元信息', to='engine.DeployStepMeta')),
            ],
            options={
                'ordering': ['id'],
            },
        ),
        migrations.AddField(
            model_name='deploystep',
            name='meta',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='instances', to='engine.DeployStepMeta', verbose_name='元信息'),
        ),
    ]
